package cn.source.school.service.impl;

import java.util.ArrayList;
import java.util.List;
import cn.source.common.utils.DateUtils;
import cn.source.majors.domain.SMajors;
import cn.source.majors.service.ISMajorsService;
import cn.source.school.domain.SchoolsmajorsDetail;
import cn.source.subject.domain.SMajorsSubjectVo;
import cn.source.subject.domain.SmSubject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.source.school.mapper.SchoolMapper;
import cn.source.school.domain.School;
import cn.source.school.service.ISchoolService;

/**
 * 学校列表Service业务层处理
 *
 * @author xuhao
 * @date 2023-12-18
 */
@Service
public class SchoolServiceImpl implements ISchoolService
{
    @Autowired
    private SchoolMapper schoolMapper;

    @Autowired
    private ISMajorsService sMajorsService;

    /**
     * 查询学校列表
     *
     * @param sId 学校列表主键
     * @return 学校列表
     */
    @Override
    public School selectSchoolBySId(Long sId)
    {
        return schoolMapper.selectSchoolBySId(sId);
    }

    /**
     * 查询学校列表列表
     *
     * @param school 学校列表
     * @return 学校列表
     */
    @Override
    public List<School> selectSchoolList(School school)
    {
        return schoolMapper.selectSchoolList(school);
    }
    
    @Override
    public List<School> selectSchoolList4Page(School school)
    {
        return schoolMapper.selectSchoolList4Page(school);
    }

    @Override
    public List<School> selectSchoolList4PageNotIn(School school)
    {
        return schoolMapper.selectSchoolList4PageNotIn(school);
    }
    
    @Override
    public List<School> selectSchoolList4H5Page(School school)
    {
        return schoolMapper.selectSchoolList4H5Page(school);
    }
    
    @Override
    public List<School> selectSchoolListByZy4Page(School school)
    {
        return schoolMapper.selectSchoolListByZy4Page(school);
    }
    
    @Override
    public List<School> selectSchoolListBy2024(School school)
    {
        return schoolMapper.selectSchoolListBy2024(school);
    }

    @Override
    public List<School> selectSchoolListBy2024NotIn(School school)
    {
        return schoolMapper.selectSchoolListBy2024NotIn(school);
    }

    /**
     * 新增学校列表
     *
     * @param school 学校列表
     * @return 结果
     */
    @Override
    public int insertSchool(School school)
    {
        school.setCreateTime(DateUtils.getNowDate());
        return schoolMapper.insertSchool(school);
    }

    /**
     * 修改学校列表
     *
     * @param school 学校列表
     * @return 结果
     */
    @Override
    public int updateSchool(School school)
    {
        school.setUpdateTime(DateUtils.getNowDate());
        return schoolMapper.updateSchool(school);
    }

    /**
     * 批量删除学校列表
     *
     * @param sIds 需要删除的学校列表主键
     * @return 结果
     */
    @Override
    public int deleteSchoolBySIds(Long[] sIds)
    {
        return schoolMapper.deleteSchoolBySIds(sIds);
    }

    /**
     * 删除学校列表信息
     *
     * @param sId 学校列表主键
     * @return 结果
     */
    @Override
    public int deleteSchoolBySId(Long sId)
    {
        return schoolMapper.deleteSchoolBySId(sId);
    }

    @Override
    public List<School> selectschoolMajorList(School scode) {

//        List<SMajors>sMajorsList=new ArrayList<>();

        List<School>schoolList=new ArrayList<>();
        schoolList =schoolMapper.selectschoolMajorList(scode);

        return schoolList;
    }

    @Override
    public List<SchoolsmajorsDetail> selectschoolSmajorsList(SchoolsmajorsDetail schoolsmajorsDetail) {
        return schoolMapper.selectschoolSmajorsList(schoolsmajorsDetail);
    }

    @Override
    public List<School> schoolsmajors(School school) {
        return schoolMapper.schoolsmajors(school);
    }

    @Override
    public List<School> selectByScodeschool(String scode) {
        return schoolMapper.selectSchoolByScode(scode);
    }

    @Override
    public List<School> selectSchoolBySname(String sname) {
        return schoolMapper.selectSchoolBySname(sname);
    }




//    @Override
//    public List<School> selectSubjectMajorList(School subject) {
//        return schoolMapper.selectSubjectMajorList(subject);
//    }
}
